package com.zutassociation.system.service.impl;

import com.zutassociation.system.domain.Elect;
import com.zutassociation.system.mapper.ElectMapper;
import com.zutassociation.system.service.ElectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 换届选举 服务层实现
 *
 * @author 黄玉东
 * @version 1.0
 * @date 2021/2/25 17:51
 */
@Service
public class ElectServiceImpl implements ElectService {

    @Autowired
    private ElectMapper electMapper;

    /**
     * 查询换届选举信息
     *
     * @param electId 换届选举ID
     * @return 换届选举信息
     */
    @Override
    public Elect selectElectById(Long electId) {
        return electMapper.selectElectById(electId);
    }

    /**
     * 查询上一条换届选举列表
     *
     * @param electId 换届选举信息
     * @return 换届选举集合
     */
    @Override
    public Elect selectUpElect(Long electId) {
        return electMapper.selectUpElect(electId);
    }

    /**
     * 查询下一条换届选举列表
     *
     * @param electId 换届选举信息
     * @return 换届选举集合
     */
    @Override
    public Elect selectNextElect(Long electId) {
        return electMapper.selectNextElect(electId);
    }

    /**
     * 查询换届选举列表
     *
     * @param elect 换届选举信息
     * @return 换届选举集合
     */
    @Override
    public List<Elect> selectElectList(Elect elect) {
        return electMapper.selectElectList(elect);
    }

    /**
     * 新增换届选举
     *
     * @param elect 换届选举信息
     * @return 结果
     */
    @Override
    public int insertElect(Elect elect) {
        return electMapper.insertElect(elect);
    }

    /**
     * 修改换届选举
     *
     * @param elect 换届选举信息
     * @return 结果
     */
    @Override
    public int updateElect(Elect elect) {
        return electMapper.updateElect(elect);
    }

    @Override
    public int updateElectClick(Elect elect) {
        return electMapper.updateElectClick(elect);
    }

    /**
     * 删除换届选举信息
     *
     * @param electId 换届选举ID
     * @return 结果
     */
    @Override
    public int deleteElectById(Long electId) {
        return electMapper.deleteElectById(electId);
    }

    /**
     * 批量删除换届选举信息
     *
     * @param electIds 需要删除的换届选举ID
     * @return 结果
     */
    @Override
    public int deleteElectByIds(Long[] electIds) {
        return electMapper.deleteElectByIds(electIds);
    }
}
